//
//  WorkTimeCell.m
//  QoilPublic
//
//  Created by SunChao on 2018/4/16.
//  Copyright © 2018年 孙超. All rights reserved.
//

#import "WorkTimeCell.h"
#import "WorkTimeModel.h"
@implementation WorkTimeCell{
    
    NSMutableArray *_array;
}

- (void)awakeFromNib {
    [super awakeFromNib];
//    float w = kScreenWidth/5;
//    self.carLabel.frame = CGRectMake(5, 5, w, 20);
//    self.totalTime.frame = CGRectMake(25, 5, w, 20);
}

- (void)setCellWithData:(NSDictionary *)dic{
    
    WorkTimeModel *model = [WorkTimeModel objectFromDict:dic];
    self.carLabel.text = model.deviceName;
    self.totalTime.text = [NSString stringWithFormat:@"%@h",model.total];
    self.workTime.text = [NSString stringWithFormat:@"%@天",model.workday];
    self.totalOil.text = [NSString stringWithFormat:@"%@L",model.totalOil];
    self.oilConLabel.text = [NSString stringWithFormat:@"%@L/h",model.oilCon];
    
    
    self.carLabel.textColor = [UIColor blackColor];
    self.totalTime.textColor = [UIColor blackColor];
    self.workTime.textColor = [UIColor blackColor];
    self.totalOil.textColor = [UIColor blackColor];
    self.oilConLabel.textColor = [UIColor blackColor];
    if ([ model.deviceName isEqualToString:@""]|| model.deviceName == nil||[ model.deviceName isEqual:[NSNull null]]) {
        self.carLabel.text = @"暂无数据";
    }
    if ([model.total isEqualToString:@""]||model.total == nil||[model.total isEqual:[NSNull null]]) {
        self.totalOil.text = @"暂无数据";
    }
    if ([model.workday isEqualToString:@""]||model.workday == nil||[model.workday isEqual:[NSNull null]]) {
        self.workTime.text = @"暂无数据";
    }
    if ([model.totalOil isEqualToString:@""]||model.totalOil == nil||[model.totalOil isEqual:[NSNull null]]) {
        self.totalOil.text = @"暂无数据";
    }
    if ([model.oilCon isEqualToString:@""]||model.oilCon  == nil||[model.oilCon isEqual:[NSNull null]]) {
        self.oilConLabel.text = @"暂无数据";
    }
    
}


@end
